package com.fz.study.project.exception;

import com.fz.study.project.entity.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

//全局异常返回配置
@RestControllerAdvice
public class GlobalException {
//    配置系统出现自定义异常之后直接返回异常数据
    @ExceptionHandler(BizException.class)
    public Result bizException(BizException e){
        return Result.error(e.getMessage());
    }
}
